0.version
php bin/magento --version

0.1 Set pre-installation file system ownership and permissions
single user
find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \; && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \; && chmod u+x bin/magento

two users
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; && find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \; && chown -R :www . && chmod u+x bin/magento

cli install
php bin/magento setup:install --base-url=http://47.98.242.10/ \
--db-host=rm-bp128bhwz5hzkp596go.mysql.rds.aliyuncs.com --db-name=touming --db-user=root --db-password=fdbf6dc2018 \
--admin-firstname=shaodong --admin-lastname=luo --admin-email=adamlsd@qq.com \
--admin-user=admin --admin-password=admin123 --language=zh_Hans_CN \
--currency=CNY --timezone=Asia/Magadan --use-rewrites=1

php bin/magento setup:install --base-url=http://touming3.evebit.cn/ \
--db-host=127.0.0.1 --db-name=touming3_evebit --db-user=touming3_evebit --db-password=erehSyPedsXYhbJr \
--admin-firstname=shaodong --admin-lastname=luo --admin-email=adamlsd@qq.com \
--admin-user=admin --admin-password=admin123 --language=zh_Hans_CN \
--currency=CNY --timezone=Asia/Shanghai --use-rewrites=1

php bin/magento setup:install --base-url=http://www.touming.com/ \
--db-host=127.0.0.1 --db-name=touming --db-user=root --db-password='' \
--admin-firstname=shaodong --admin-lastname=luo --admin-email=adamlsd@qq.com \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=CNY --timezone=Aisa/Shanghai --use-rewrites=1

1.cache
bin/magento cache:clean config
bin/magento cache:clean full_page block_html
bin/magento cache:flush
bin/magento cache:status
bin/magento cache:enable
bin/magento cache:disable full_page block_html
bin/magento setup:static-content:deploy -f -s

2.indexers
bin/magento indexer:info
bin/magento indexer:status [indexer]
bin/magento indexer:reindex customer_grid
bin/magento indexer:show-mode [indexer]
bin/magento indexer:set-mode {realtime|schedule} [indexer]

3.cron
php bin/magento cron:install [--force]
php bin/magento cron:run --group index
php bin/magento cron:remove

4.code compiler
static 文件404
bin/magento setup:di:compile
php bin/magento module:enable --all --clear-static-content
bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

5.dev
php bin/magento dev:query-log:enable
php bin/magento dev:query-log:disable

6.set the magento mode
bin/magento deploy:mode:show
bin/magento deploy:mode:set production
bin/magento deploy:mode:set developer
bin/magento deploy:mode:set default



7.Set the value of bootstrap parameters
Enable profiling (MAGE_PROFILER)
SetEnv MAGE_PROFILER firebug
SetEnv MAGE_PROFILERcsvfile
SetEnv MAGE_PROFILER<custom value>

8.
drag and drop row
1.Category product
2.Product detail tier price
3.Product detail customizable option

9.add custom css
Create new file at Vendor/Module/view/adminhtml/web/css/source/_module.less
rm -rf var/view_preprocessed/
rm -rf pub/static/adminhtml
php bin/magento setup:static-content:deploy -f

10.maintenance mode
bin/magento maintenance:enable
bin/magento maintenance:disable
except ip
bin/magento maintenance:enable --ip=192.0.2.10 --ip=192.0.2.11

11.Create the Magento crontab
Log in as, or switch to, the Magento file system owner.
php bin/magento cron:install [--force]


12.create admin user cli
php bin/magento admin:user:create --admin-user='admin' --admin-password='admin123' --admin-email='runxindong@gmail.com' --admin-firstname='shaodong' --admin-lastname='luo'

13.update base_url

select * from core_config_data where path like "%base_url%" or path like "%base_link_url%";

update core_config_data set value = "http://www.magento.kiwiin.com/" where path like "%base_url%" or path like "%base_link_url%";

13.Use Redis for the Magento page and default cache

bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=127.0.0.1 --cache-backend-redis-db=0

bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=127.0.0.1 --page-cache-redis-db=1


redis-cli monitor

14.Use Redis for session storage

bin/magento setup:config:set --session-save=redis --session-save-redis-host=127.0.0.1 --session-save-redis-log-level=3 --session-save-redis-db=2

or save session in files
bin/magento setup:config:set --session-save=files

15.create database and user
create database kiwiin;
create user kiwiin IDENTIFIED BY 'kiwiin';
GRANT ALL ON kiwiin.* TO kiwiin@localhost IDENTIFIED BY 'kiwiin';
flush privileges;

select * from core_config_data where path like "%base_url%" or path like "%base_link_url%";

update core_config_data set value = "http://www.adelaidetyre.com/" where path like "%base_url%" or path like "%base_link_url%";

16.deploy，生成静态文件

rm -rf generated/metadata/* generated/code/*
rm -rf var/view_preprocessed/ var/cache/ var/page_cache
rm -rf pub/static/frontend pub/static/adminhtml

bin/magento cache:clean
bin/magento cache:flush
bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f -s standard
bin/magento setup:static-content:deploy -f -s quick

bin/magento setup:static-content:deploy -f en_GB zh_Hans_CN de_DE
bin/magento setup:static-content:deploy -f en_GB zh_Hans_CN de_DE en_US --theme Magento/backend --theme Smartwave/porto
bin/magento setup:static-content:deploy -f en_US

bin/magento setup:static-content:deploy -f en_GB zh_Hans_CN de_DE  --theme Smartwave/porto

bin/magento setup:static-content:deploy -f zh_Hans_CN  --theme Smartwave/porto



17.languages
bin/magento info:language:list

18.enable and disable module
bin/magento module:disable Alwayly_Wlogin
